<?

//Magic Core System
//Provides extension possibilities and some php convenience functions

//Load config
require_once("conf.php");

$conf = core_conf();

//Load available functions
$list = scandir($conf['modules_dir']);
$enabled_mods = array();

foreach($list as $module){
   $pos_on = strpos($module, "on");
   $pos_off = strpos($module, "off");
      if($pos_on !== FALSE || $pos_off !== FALSE){
         if($pos_on !== FALSE){
         $enabled_mods[] = $module; 
         }
         continue;
      }         
}

//Include the enabled modules
foreach($enabled_mods as $mod){
   $eval_str = 'require_once("'.$conf["modules_dir"].'/'.$mod.'");';
   eval($eval_str);
}

//Show html template 
function display_template($template){
  global $conf;
  $dir = $conf['template_dir'];
  $full = $dir.'/'.$template;
  $eval_sr = 'require_once("'.$conf["template_dir"].'/'.$template.'");';
  require_once($full);
}

?>
